GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

EditorActions.js ➔ ???   B
last analyzed

Complexity

Conditions 2
Paths 1

Size

Total Lines 27

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
c 1
b 0
f 0
nc 1
dl 0
loc 27
rs 8.8571
nop 1
1
import {
2
    ADD_NEW_ROW,
3
    CANCEL_ROW,
4
    DISMISS_EDITOR,
5
    EDIT_ROW,
6
    EDITOR_VALIDATION,
7
    ROW_VALUE_CHANGE,
8
    REMOVE_ROW,
9
    REPOSITION_EDITOR,
10
    SAVE_ROW,
11
    UPDATE_ROW
12
} from '../../../constants/ActionTypes';
13
14
import { keyGenerator } from '../../../util/keyGenerator';
15
import { getNewRowId } from '../../../util/getNewRowId';
16
17
export const editRow = ({
18
    rowId,
19
    top,
20
    rowData = {},
21
    rowIndex,
22
    columns,
23
    isCreate,
24
    stateKey,
25
    editMode = 'inline'
26
}) => {
27
28
    if (!rowId) {
29
        throw new Error('rowId is a required parameter for editRow Action');
30
    }
31
32
    return {
33
        type: EDIT_ROW,
34
        rowId,
35
        top,
36
        values: rowData,
37
        rowIndex,
38
        columns,
39
        isCreate,
40
        stateKey,
41
        editMode
42
    };
43
};
44
45
export const repositionEditor = ({ top, stateKey, rowId }) => ({
46
    type: REPOSITION_EDITOR,
47
    rowId,
48
    stateKey,
49
    top
50
});
51
52
export const dismissEditor = ({ stateKey }) => ({
53
    type: DISMISS_EDITOR, stateKey
54
});
55
56
export const updateCellValue = ({
57
    value, name, column, columns, stateKey, rowId
58
}) => ({
59
    type: ROW_VALUE_CHANGE,
60
    value,
61
    columnName: name,
62
    column,
63
    columns,
64
    stateKey,
65
    rowId
66
});
67
68
export const saveRow = ({ values, rowIndex, stateKey }) => ({
69
    type: SAVE_ROW, values, rowIndex, stateKey
70
});
71
72
export const cancelRow = ({ stateKey }) => ({
73
    type: CANCEL_ROW, stateKey
74
});
75
76
export const removeRow = ({ rowIndex, stateKey }) => ({
77
    type: REMOVE_ROW, rowIndex, stateKey
78
});
79
80
export const setEditorValidation = ({ validationState, stateKey }) => ({
81
    type: EDITOR_VALIDATION, validationState, stateKey
82
});
83
84
export const updateRow = ({ stateKey, rowIndex, values }) => ({
85
    type: UPDATE_ROW,
86
    stateKey,
87
    rowIndex,
88
    values
89
});
90
91
export const addNewRow = ({
92
    columns,
93
    data,
94
    stateKey,
95
    editMode = 'inline',
96
    rowIndex = 0,
97
    isCreate = true
98
}) => (dispatch) => {
99
    const rowId = keyGenerator('row', getNewRowId());
100
    const top = 43;
101
    const rowData = data || {};
102
103
    dispatch({ type: ADD_NEW_ROW, stateKey, rowId, rowIndex });
104
105
    dispatch(
106
        editRow({
107
            rowId,
108
            top,
109
            rowData,
110
            rowIndex,
111
            columns,
112
            isCreate,
113
            stateKey,
114
            editMode
115
        })
116
    );
117
};
118